local huaizi = fk.CreateSkill {
  name = "tyj_heg__huaizi",
}
local H = require "packages.ol_hegemony.util"
local U = require "packages.utility.utility"
Fk:loadTranslationTable{
      ["tyj_heg__huaizi"]="怀子",
      [":tyj_heg__huaizi"]="你首次明置此武将牌后，你获得三枚阴阳鱼标记。准备阶段，你选择一项：1.移去一枚阴阳鱼标记，获得一枚珠联璧合标记；2.移去一枚珠联璧合标记，获得〖武圣〗〖当先〗〖制蛮〗中的一个。",
      ["$tyj_heg__huaizi1"] = "妾死则矣，腹中稚婴何辜？",
      ["$tyj_heg__huaizi2"] = "身怀六甲，君忘好生之德乎？",
      ["~tyj_heg__zhuzhi"]="臣辅孙氏三代之业，今年近古稀，死而无憾。",
      ["#tyj_heg_huaizi-fish"]="弃阴阳鱼",
      ["#tyj_heg_huaizi-comp"]="弃珠联璧合",
    }
    huaizi:addEffect(fk.GeneralRevealed,{
    anim_type = "special",
    can_trigger = function(self, event, target, player, data)
        if player == target and player:hasSkill(huaizi.name) and player:getMark(huaizi.name) == 0 then
          for _, v in pairs(data) do
            if table.contains(Fk.generals[v]:getSkillNameList(), huaizi.name) then return true end
          end
        end
      end,
      on_cost = function(self, event, target, player, data)
        return true
      end,
      on_use = function(self, event, target, player, data)
        local room = player.room
        room:setPlayerMark(player,huaizi.name,1)
      H.addHegMark(player.room, player, "yinyangfish",3)
      end,
    })
    huaizi:addEffect(fk.EventPhaseStart,{
      anim_type = "special",
      can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(huaizi.name) and
            target.phase == Player.Start and (player:getMark("@!!companion")>0 or player:getMark("@!!yinyangfish")>0)
    end,
    on_cost = function(self, event, target, player, data)
        return true
      end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local all_choices = {"#tyj_heg_huaizi-fish","#tyj_heg_huaizi-comp"}
        local choices = {}
        if player:getMark("@!!yinyangfish")>0 then
          table.insert(choices,"#tyj_heg_huaizi-fish")
        end
        if player:getMark("@!!companion")>0 then
          table.insert(choices,"#tyj_heg_huaizi-comp")
        end
        if #choices>0 then
        local choice = room:askToChoice(player,{
          choices = choices,
          all_choices = all_choices,
          prompt="怀子：请选择一项",
          skill_name = huaizi.name
        })
        if choice == "#tyj_heg_huaizi-fish" then
          H.removeHegMark(room, player, "yinyangfish")
          H.addHegMark(room, player, "companion")
        else
          H.removeHegMark(room, player, "companion")
          if player.dead then return end
    local choices = {"hs__wusheng", "dangxian", "new_ld__zhiman"}
    for i = 3, 1, -1 do
      if player:hasSkill(choices[i], true) then
        table.removeOne(choices, choices[i])
      end
    end
    if #choices > 0 then
      local choice = player.room:askToChoice(player, {
        choices = choices,
        skill_name = huaizi.name,
        prompt = "怀子：获得其中一个技能",
        detailed = true,
      })
      player.room:handleAddLoseSkills(player, choice)
    end
        end
      end
      end,
    })
    return huaizi